package test3;

import java.util.Scanner;

public class games {
    public static void main(String[] args) {
        games a=new games();
        int b=(int)(Math.random()*3+1);
        Scanner sc=new Scanner(System.in);
        System.out.println("请出拳1.剪刀2.石头3.布（输入相对数字）");
        int c=sc.nextInt();
        a.Start(c,b);
    }

    public void Start(int c,int b){
        if(c==1&&b==2){
            System.out.println("你出剪刀");
            System.out.println("电脑出石头");
            System.out.println("你输了");
        }else if (c==2 &&b==3){
            System.out.println("你出石头");
            System.out.println("电脑出布");
            System.out.println("你输了");
        }else if (c==3 &&b==1){
            System.out.println("你出布");
            System.out.println("电脑出剪刀");
            System.out.println("你输了");
        }else if(c==b){
            System.out.println("平局");
        }else{
            System.out.println("你赢了");
        }
    }
}
